<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/WEB-INF/adminui/include/css.jsp" %>
<title>收费项目列表</title>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div id="toolbar" class="columns pull-left">
							<qx:perm code="sfgl_feeItem_ADD">
							<button type="button" class="btn btn-primary" onclick="add()">
								<i class="fa fa-plus hidden" aria-hidden="true"></i>添加
							</button>
							</qx:perm>
							<qx:perm code="sfgl_feeItem_DEL">
							<button type="button" class="btn btn-danger multi" onclick="del()">
								<i class="fa fa-trash hidden" aria-hidden="true"></i>删除
							</button>
							</qx:perm>
						</div>
					</div>
					<table id="dataTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<%@ include file="/WEB-INF/adminui/include/script.jsp" %>
<script type="text/javascript">
$(function(){
	UiList.render({
		tableConfig:{
			url: "${path}/feeItem/listdata.json",
			idfield: 'itemid',
			columns: [
				{checkbox : true},
				{field : 'prjcode', title : '项目代码'},
				{field : 'prjname', title : '项目名称'},
				{field : 'feeMode', title : '收费方式', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '周期性';
					case '1': return '临时性';
					}
					return ''+value;
				}},
				{field : 'chargeMode', title : '计费方式', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '建面';
					case '1': return '定额';
					case '2': return '公式';
					case '3': return '抄表';
					}
					return ''+value;
				}},
				{field : 'feeType', title : '收费类型', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '普通';
					case '1': return '押金';
					case '1': return '预收款';
					}
					return ''+value;
				}},
				{field : 'cycle', title : '计费周期'},
				{field : 'cycleNum', title : '计费周期数'},
				{field : 'gardenName', title : '计费周期单位'},
				{field : 'price', title : '计费单价'},
				{field : 'isfee', title : '是否收费', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '否';
					case '1': return '是';
					}
					return ''+value;
				}},
				{field : 'accuracy', title : '计费精度', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '元';
					case '1': return '角';
					case '2': return '分';
					}
					return ''+value;
				}},
				{field : 'printIndex', title : '打印次序'},
				{field : 'tiered', title : '是否阶梯', formatter : function(value, row, index) {
					switch(''+value){
					case '0': return '否';
					case '1': return '是';
					}
					return ''+value;
				}},
				{field : 'latePaymentsRate', title : '滞纳金率'},
				{field : 'latePaymentsDays', title : '滞纳金开始天数'},
				{field : 'incrementMonths', title : '递增月份数'},
				{field : 'incrementPercent', title : '递增百分比'},
				{field : 'formulas', title : '计算公式'},
				{field : 'itemid', title : '操作', align : 'center', formatter : function(value, row, index) {
					var s = '';
					<qx:perm code="sfgl_feeItem_EDIT">
					s += '<a class="btn btn-primary btn-sm" href="javascript:;" title="修改" onclick="edit(\''+value+'\')">修改</a> ';
					</qx:perm>
					return s;
				}}
			]
		}
	});
	
});

function add(){
	UiList.open('${path}/feeItem/add.do', '添加收费项目', {full:true});
}
function del(){
	UiList.dialog('${path}/feeItem/delete.json', '您确定要删除选中的收费项目吗？', '删除收费项目成功.');
}
function edit(id){
	UiList.open('${path}/feeItem/edit.do?itemid='+id, '修改收费项目', {full:true});
}

</script>
</body>
</html>